package com.caine.proxy.cglib;

import net.sf.cglib.Enhancer;
import net.sf.cglib.MethodInterceptor;
import net.sf.cglib.MethodProxy;
import net.sf.cglib.NoOpInterceptor;

import java.lang.reflect.Method;

/**
 * @Author: CaineZhu
 * @Description:
 * @Date: Created in 16:46 2020/11/4
 * @Modified By: cglib代理
 */
public class CglibProxyTest {
    public static void main(String[] args) {
        CglibService service = (CglibService) Enhancer
                .enhance(CglibService.class,
                        CglibService.class.getInterfaces(),
                        new CglibMethodInterceptor()
                        /*new NoOpInterceptor()*/);
        service.say("李四");
    }
}
